<?php
$src = $_GET['src'];

$handle = $_GET['handle'];
$id = $_GET['id'];

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" charset="utf-8" src="../../cooperation_base.js"></script>
<script type="text/javascript" charset="utf-8" src="js/jquery.imgareaselect.min.js"></script>
<link href="css/imgareaselect-animated.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
data = null;
window.onload = function(){
    $('#photo').imgAreaSelect({
        handles: true,
        aspectRatio: "229:299",
        minWidth: 229,
        minHeight: 299,
        x1:0,y1:0,x2:229,y2:299,
        onSelectEnd: function(img, selection){
            selection.h = "<?php echo $handle;?>";   
            selection.id = "<?php echo $id;?>";   
            selection.src = "<?php echo $src;?>";
            selection.thumb = "<?php echo $_GET['thumb'];?>";
            data = selection;
        }
    });
}
function cut(){
    if(!data){
        return false;
    }
    $.getJSON('/handle.php', data, function(data){
        alert(data.msg)      
        window.location = "/admin/app_activity_overdue";
    })
}
</script>
</head>
<body>
<div>
<img id="photo" src="<?php echo $root.$src;?>" alt="">
</div>
<div>
<a href="#" onclick="cut();return false;">裁剪</a>
</div>



</body>
</html>